The issue is not only about who wrote the Pentateuch (and other books of the Hebrew Scripture) but who edited the books during the ensuing centuries and the motives of these editors, as well as the accuracy of their understanding of events that had taken place some centuries before.
The Hebrew record of their history is influenced by their theological focus, rather than precision in the record; hence differences, for example between the books of Kings and Chronicles. As another example, whereas political reality said that Assyria defeated Israel because of its overwhelming might, the Hebrews wrote that Israel was destroyed because the nation did not listen to God's prophets and priests.
Unlike the record of their neighbours, whose records were intent on praising the reigning monarch of the time, the Hebrew Scriptures were a product of the religious elite endeavouring to promote and preserve their power and influence. We do not see the records of their opponents.
There is no doubt that the Babylonian exiles (who were the intelligentsia of the Hebrews) played a major role in the shape and content of the record we now have. Whether they wrote Deuteronomy or simply edited it, it is plain they had a great impact on the text we now have.